﻿@model ShippingSettingsModel

@using (Html.BeginForm())
{
    
<script type="text/javascript">
    $(document).ready(function () {
        $("#@Html.FieldIdFor(model => model.FreeShippingOverXEnabled)").click(toggleFreeShippingOverX);
            
        toggleFreeShippingOverX();
    });

    function toggleFreeShippingOverX() {
        if (getE('@Html.FieldIdFor(model => model.FreeShippingOverXEnabled)').checked) {
            $('#pnlValueOfX').show();
            $('#pnlValueOfXincltax').show();
        }
        else {
            $('#pnlValueOfX').hide();
            $('#pnlValueOfXincltax').hide();
        }
    }

</script>
    
    <div class="section-header">
        <div class="title">
            <img src="@Url.Content("~/Administration/Content/images/ico-configuration.png")" alt="" />
            @T("Admin.Configuration.Settings.Shipping")
        </div>
        <div class="options">
            <button type="submit" name="save" value="save" class="t-button">@T("Admin.Common.Save")</button>
        </div>
    </div>
@Html.ValidationSummary(false)
    <table class="adminContent">
        <tr>
            <td class="adminTitle">
                @Html.NopLabelFor(model => model.FreeShippingOverXEnabled):
            </td>
            <td class="adminData">
                @Html.EditorFor(model => model.FreeShippingOverXEnabled)
                @Html.ValidationMessageFor(model => model.FreeShippingOverXEnabled)
            </td>
        </tr>
        <tr id="pnlValueOfX">
            <td class="adminTitle">
                @Html.NopLabelFor(model => model.FreeShippingOverXValue):
            </td>
            <td class="adminData">
                @Html.EditorFor(model => model.FreeShippingOverXValue)
                @Html.ValidationMessageFor(model => model.FreeShippingOverXValue)
            </td>
        </tr>
        <tr id="pnlValueOfXincltax">
            <td class="adminTitle">
                @Html.NopLabelFor(model => model.FreeShippingOverXIncludingTax):
            </td>
            <td class="adminData">
                @Html.EditorFor(model => model.FreeShippingOverXIncludingTax)
                @Html.ValidationMessageFor(model => model.FreeShippingOverXIncludingTax)
            </td>
        </tr>
        <tr>
            <td class="adminTitle">
                @Html.NopLabelFor(model => model.EstimateShippingEnabled):
            </td>
            <td class="adminData">
                @Html.EditorFor(model => model.EstimateShippingEnabled)
                @Html.ValidationMessageFor(model => model.EstimateShippingEnabled)
            </td>
        </tr>
        <tr>
            <td class="adminTitle">
                @Html.NopLabelFor(model => model.DisplayShipmentEventsToCustomers):
            </td>
            <td class="adminData">
                @Html.EditorFor(model => model.DisplayShipmentEventsToCustomers)
                @Html.ValidationMessageFor(model => model.DisplayShipmentEventsToCustomers)
            </td>
        </tr>
        <tr>
            <td class="adminTitle" colspan="2">
                <b>@Html.LabelFor(model => model.ShippingOriginAddress):</b>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                @Html.EditorFor(x => x.ShippingOriginAddress, "Address")
            </td>
        </tr>        
        <tr class="adminSeparator">
            <td colspan="2">
                <hr />
            </td>
        </tr>
    </table>
}